﻿if exists (select 1
            from  sysobjects
           where  id = object_id('t_product_rank')
            and   type = 'U')
   drop table t_product_rank
go

/*==============================================================*/
/* Table: t_product_rank                                        */
/*==============================================================*/
create table t_product_rank (
   id                   bigint               identity,
   created_time         datetime             not null,
   created_by           bigint               not null,
   last_updated_time    datetime             null,
   last_updated_by      bigint               null,
   product_id           varchar(16)          null,
   rank                 int                  null,
   author_id            varchar(16)          null,
   author_name          nvarchar(32)         null,
   author_head_img      varchar(256)         null,
   constraint PK_T_PRODUCT_RANK primary key (id)
)
go

if exists (select 1 from  sys.extended_properties
           where major_id = object_id('t_product_rank') and minor_id = 0)
begin 
   declare @CurrentUser sysname 
select @CurrentUser = user_name() 
execute sp_dropextendedproperty 'MS_Description',  
   'user', @CurrentUser, 'table', 't_product_rank' 
 
end 


select @CurrentUser = user_name() 
execute sp_addextendedproperty 'MS_Description',  
   '商品达人榜', 
   'user', @CurrentUser, 'table', 't_product_rank'
go
